package cn.iocoder.yudao.module.pplan.dal.mysql.tablewaredistplan;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pplan.controller.admin.tablewaredistplan.vo.TablewareDistPlanPageReqVO;
import cn.iocoder.yudao.module.pplan.dal.dataobject.tablewaredistplan.TablewareDistPlanDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 生产计划餐具配送计划 Mapper
 *
 * @author yisl
 */
@Mapper
public interface TablewareDistPlanMapper extends BaseMapperX<TablewareDistPlanDO> {

    default PageResult<TablewareDistPlanDO> selectPage(TablewareDistPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TablewareDistPlanDO>()
                .likeIfPresent(TablewareDistPlanDO::getPlanCode, reqVO.getPlanCode())
                .likeIfPresent(TablewareDistPlanDO::getFlightNo, reqVO.getFlightNo())
                .eqIfPresent(TablewareDistPlanDO::getDistStatus, reqVO.getDistStatus())
                .geIfPresent(TablewareDistPlanDO::getStartDate, reqVO.getStartDate())
                .leIfPresent(TablewareDistPlanDO::getEndDate, reqVO.getEndDate())
                .orderByDesc(TablewareDistPlanDO::getId));
    }

}